import page
from base.base import Base
import time

from tools.get_log import GetLog

log = GetLog.get_logger()


class PageAxaLogin(Base):

    # 用户名/手机/邮箱
    def page_input_memberName(self, axa_memberName):
        self.base_input(page.axa_memberName, axa_memberName)

    # 密码
    def page_input_password(self, axa_password):
        self.base_input(page.axa_password, axa_password)

    # 验证码
    def page_input_code(self, axa_code):
        self.base_input(page.axa_code, axa_code)

    # 登陆
    def page_click_login_btn(self):
        self.base_click(page.axa_login_btn)
        time.sleep(2)

    # 组织 业务
    def page_axa_login(self, axa_memberName, axa_password, axa_code):
        log.info("正在执行登陆操作，用户:{},密码：{},验证码：{}".format(axa_memberName, axa_password, axa_code))
        self.page_input_memberName(axa_memberName)
        self.page_input_password(axa_password)
        self.page_input_code(axa_code)
        self.page_click_login_btn()
